package com.lx.mobileplayer.mvp.view.adapter


import android.widget.ImageView
import android.widget.TextView
import com.lx.mobileplayer.R
import com.lx.mobileplayer.ext.loadImage
import com.lx.mobileplayer.mvp.model.YueDanItemBean
import jp.wasabeef.picasso.transformations.CropCircleTransformation

/**
 * 类说明：首页的adapter
 * Created by liuxiong on 2019/4/24.
 */
class YueDanAdapter(data:ArrayList<YueDanItemBean.PlayListsBean>): BaseListAdapter<YueDanItemBean.PlayListsBean>(R.layout.item_yuedan,data) {

    constructor():this(ArrayList<YueDanItemBean.PlayListsBean>())

    override fun onBindDataToView(holder: BaseViewHodler, bean: YueDanItemBean.PlayListsBean) {

        holder.getView<TextView>(R.id.title)?.text = bean.title
        holder.getView<TextView>(R.id.author_name)?.text = bean.creator?.nickName
        holder.getView<TextView>(R.id.count)?.text = bean.videoCount.toString()

        holder.getView<ImageView>(R.id.bg)?.loadImage(bean.playListBigPic)
        holder.getView<ImageView>(R.id.author_image)?.loadImage(bean.creator?.largeAvatar, CropCircleTransformation())
    }
}